package test4

object Impl {
  def main(args: Array[String]): Unit = {
    implicit def bool2int(x:Boolean):Int=if(x) 1 else 0;
    println(1+true)
    println(1+false)
    //val fun=scala.math.ceil(100)
    //println(fun())
    val f1=(x:Int)=>{x*x}
    println(f1(20))
    println(f1(50))
    val f2=f1
    println(f2(5))
    println(lifang(4))
    var f3=lifang _;
    //f3=lifang //有错误
    println(f3(3))
    var f5=scala.math.ceil _;


    var temp=List(1,2,3,4)
    //var he=temp.scanLeft(0)(_+_)
    var he=(0/:temp)(_+_)
    println(">>>>"+he)
  }
  def lifang(x:Int):Int={
     x*x*x
  }
}
